const RouteView = {
  name: 'RouteView',
  render: (h) => h('router-view'),
}

export const asyncRouterMap = [
  {
    path: '/',
    name: 'layoutHome',
    component: () => import(/* webpackChunkName: "home" */ '@/pages/home/layoutHome.vue'),
    meta: { title: '首页' },
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/home/home.vue'),
        meta: {
          title: '首页',
          current: '/home',
        },
      },
      {
        path: '/music',
        name: 'music',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/toolClass/music/index.vue'),
        meta: {
          title: '音乐',
          current: '/music',
        },
      },
      {
        path: '/divination',
        name: 'divination',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/toolClass/divination/index.vue'),
        meta: {
          title: '占卜',
          current: '/divination',
        },
      },
      {
        path: '/diningPool',
        name: 'diningPool',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/toolClass/diningPool/index.vue'),
        meta: {
          title: '干饭星球',
          current: '/diningPool',
        },
      },
      {
        path: '/iframes',
        name: 'iframes',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/toolClass/iframes/index.vue'),
        meta: {
          title: 'iframe页面',
          current: '/iframes',
        },
      },
      {
        path: '/codemirror',
        name: 'codemirror',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/toolClass/codemirror/index.vue'),
        meta: {
          title: 'codemirror',
          current: '/codemirror',
        },
      },
      {
        path: '/colorall',
        name: 'colorall',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/toolClass/color-all/index.vue'),
        meta: {
          title: 'colorall',
          current: '/colorall',
        },
      },
      {
        path: '/divBox',
        name: 'divBox',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/toolClass/divBox/index.vue'),
        meta: {
          title: 'divBox',
          current: '/divBox',
        },
      },
      {
        path: '/chunkupload',
        name: 'chunkupload',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/toolClass/chunkupload/index.vue'),
        meta: {
          title: 'chunkupload',
          current: '/chunkupload',
        },
      }, 
      {
        path: '/videoFiv',
        name: 'videoFiv',
        component: () => import(/* webpackChunkName: "home" */ '@/pages/videoFiv/index.vue'),
        meta: {
          title: 'videoFiv',
          current: '/videoFiv',
        },
      },
    ],
  },
]

export const constantRouteMap = [
  {
    path: '/login',
    component: RouteView,
    meta: { title: '登录' },
    redirect: '/login',
    children: [
      {
        path: '/login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/Login'),
        meta: { title: '登录' },
      },
    ],
  },
  ...asyncRouterMap,
]
